First Steps Using Helm
Get introduced to what we’ll build in the upcoming lessons. Also get acquainted with the first Helm commands.
Now that we’ve got a basic understanding of what Helm is and our development environment up and running we’ll be using Helm to build a small project. Let’s go over the description in this lesson.
In this part of the chapter we’ll learn how to use Helm to install charts that were prepared by other developers.
Helm has a big, thriving community of developers who create and maintain a huge number of Helm charts that are available for free. They can be found on Artifact Hub.
What will be built#
In this course, we’ll be installing a couple of Helm charts. Usually, it will result in more than one Kubernetes objects being created or updated. We will get confirmation from Helm that a chart has been installed, but there will be no detailed information about all the Kubernetes objects that have been installed.
To check them we would need to use the kubectl command-line tool or one of the tools like the VS Code extension for Kubernetes.
But this is not very convenient. Sure, those non-kubectl tools can be very handy, but they have to be installed and configured on local machines. Some organizations prefer to not allow their employees to have these tools, usually due to security reasons. An alternative would be to create a website with a dashboard to which the company’s administrators can grant access.
One of the most popular Kubernetes online dashboards is the one that is officially supported, the Kubernetes Dashboard. Here are some sample screenshots of it:
And this is what we’ll be installing and customizing in the next lessons. This will enable us to practically learn Helm and its concepts.
At the end of this chapter, we’ll have a tool that will allow us to have quick access to the entire Kubernetes cluster.
Of course, there are alternatives to the official Kubernetes Dashboard. For some Kubernetes distributions, like Docker Desktop or minikube, a dashboard is already bundled in it, and enabling it is just a matter of a few clicks or commands. In Minishift, the dashboard is called console and looks a little bit different, much more similar to the ones from Red Hat that are intended to be used on production—OKD and OpenShift.
We can see a representation of a cluster that will be built in this part of the course below. In the following parts, we’ll extend it by adding more pieces (more namespaces and more Helm releases).
Working with Helm CLI#
Helm is a command-line tool, which means that most of the time we’ll be interacting with it using a terminal. Some tools are built on top of Helm and have a user-friendly UI, but they’re not that mature and they don’t have all the features that CLI has.
Helm CLI is really easy to use and most of its commands will be introduced in this course.
The helm help command and the --help flag#
Let’s start with a basic command which can be used when we get stuck with anything—a help command.
In our terminal, let’s type the following command:
Hint: The same result can be achieved by typing only
helm, withouthelp.
With this simple command we’ve listed two things:
Environment variables that can be adjusted to configure the Helm client
All Helm commands that can be invoked
Therefore, whenever we feel lost or see an unknown command in someone’s code we can check it with the helm help command.
If a short description of a command is not enough, which is understandable as they could be quite complex and require multiple arguments, it’s possible to get more details for each of them.
To get more details on a specific command we need to add the --help flag after the command. For example, here is the output for the helm install command (please use a previous interactive widget to get an output):
From the output we can see there is a lot of information here with a detailed explanation of how helm install works and how an installation can be tuned. Most of the information here will be explained in the upcoming lessons. Of course, not everything will be used in the course; otherwise, it would become a very long one. However, we’ll definitely take a closer look at the most important one. The remaining ones we can check with the --flag and see if they fit our needs.
The helm version command#
Another useful command is for checking the Helm version. Here is the output from a terminal:
The output will be as follows:
version.BuildInfo{Version:"v3.11.0", GitCommit:"472c5736ab01133de504a826bd9ee12cbe4e7904", GitTreeState:"clean", GoVersion:"go1.18.10"}
In this course we’ll be using v3 of Helm, so we have to make sure that we have installed the correct version.
The helm env command#
The previously mentioned helm help command prints out information about the environment variables that are used to configure the Helm client. If we want to see what value is assigned to each one of them, we can use the following command:
The output will be:
HELM_BIN=<YOUR_PATH_TO_HELM_BIN>
HELM_CACHE_HOME=<YOUR_PATH_TO_HELM_CACHE>
HELM_CONFIG_HOME=<YOUR_PATH_TO_HELM_CONFIG>
HELM_DATA_HOME=<YOUR_PATH_TO_HELM_CONFIG>
HELM_DEBUG="false"
HELM_KUBEAPISERVER=""
HELM_KUBEASGROUPS=""
HELM_KUBEASUSER=""
HELM_KUBECAFILE=""
HELM_KUBECONTEXT=""
HELM_KUBETOKEN=""
HELM_MAX_HISTORY="10"
HELM_NAMESPACE="monitoring"
HELM_PLUGINS=<YOUR_PATH_TO_HELM_PLUGINS>
HELM_REGISTRY_CONFIG=<YOUR_PATH_TO_HELM_CONFIG>
HELM_REPOSITORY_CACHE=<YOUR_PATH_TO_HELM_CACHE>
HELM_REPOSITORY_CONFIG=<YOUR_PATH_TO_HELM_CONFIG>
This might be very useful in situations where we would like to debug our Helm client configuration.
Stop, Restart, and Delete a Cluster
Add a Helm Repository